package ooday01;

public class Student {
   /* String name;       //作用：给成员变量赋初始值
    int age;          //语法：与类同名，没有返回值类型（连void都没有
    String className;  //调用：在创建（new)对象被自动调用
    String stuId;

    Student(){

    }
    Student(String name,int age){
        this.name=name;
        this.age=age;

    }
    Student(String name,int age, String className,String sutId){
        this.name=name;
        this.age=age;
        this.className=className;
        this.stuId=sutId;
    }

    void say(){
        System.out.println(this.name+"在学习");

    }
    void sayHi(){
        System.out.println("大家好，我叫"+this.name+"我今年"+this.age+"岁了，所在班级为"+this.className+"我的学号为:"+this.stuId);
    }
    void playWith(String anotherName){
        System.out.println(this.name+"正在和"+anotherName+"一起玩....");
    }*/



    String name;
    int age;
    String className;
    String sutId;


    Student(){

    }

    Student(String name,int age){
        this.name=name;
        this.age=age;

    }
    Student(String name,int age,String className,String sutId){
        this.name=name;
        this.age=age;
        this.className=className;
        this.sutId=sutId;
    }

    void say(){
        System.out.println(this.name+"在学习");
    }

    void sayHi(){
        System.out.println(this.name+"在学习，他今年"+this.age+"他的班级是"+this.className+"学号为"+this.sutId );
    }
    void playWith(String anotherName){
        System.out.println(this.name+"正在和"+anotherName+"一起玩");
    }

}
